package com.pgybook.db.entity.mapper;

import org.springframework.stereotype.Repository;
import com.pgybook.db.entity.domain.RolePrivilegeEx;
import com.pgybook.db.entity.domain.RolePrivilegeKey;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

@Repository
public interface RolePrivilegeMapper {
    int countByExample(RolePrivilegeEx example);

    int deleteByExample(RolePrivilegeEx example);

    @Delete({
            "delete from roleprivilege",
            "where ROLE_ID = #{roleId,jdbcType=INTEGER}",
            "and PRI_ID = #{priId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(RolePrivilegeKey key);

    @Insert({
            "insert into roleprivilege (ROLE_ID, PRI_ID)",
            "values (#{roleId,jdbcType=INTEGER}, #{priId,jdbcType=INTEGER})"
    })
    int insert(RolePrivilegeKey record);

    int insertSelective(RolePrivilegeKey record);

    List<RolePrivilegeKey> selectByExample(RolePrivilegeEx example);

    int updateByExampleSelective(@Param("record") RolePrivilegeKey record, @Param("example") RolePrivilegeEx example);

    int updateByExample(@Param("record") RolePrivilegeKey record, @Param("example") RolePrivilegeEx example);
}
